﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views.components.sunface.states {
    import flash.events.*;
    import flash.display.*;
    import net.wooga.pets.events.*;
    import net.wooga.pets.views.components.sunface.*;
    import net.wooga.pets.utils.timeline.*;
    import flash.errors.*;

    public class SunFaceBaseState implements ISunFaceState {

        private const FRAME_LABEL_IS_NOT_FOUND_ON_TIMELINE:FrameLabel = null;

        private var _timeline:SequenceBasedStatesTimeline;
        private var _context:SunFaceStateManager;

        private static const DEFAULT_FRAME_LABEL:String = "happy";

        public function SunFaceBaseState(_arg1:SunFaceStateManager, _arg2:SequenceBasedStatesTimeline){
            this._context = _arg1;
            this._timeline = _arg2;
            this.timeline.addEventListener(Event.COMPLETE, this.onSequenceComplete);
        }
        public function initiate():void{
            throw (new IllegalOperationError("This is a base class, overwrite this method"));
        }
        public function talk():void{
            throw (new IllegalOperationError("This is a base class, overwrite this method"));
        }
        public function idle():void{
            throw (new IllegalOperationError("This is a base class, overwrite this method"));
        }
        public function click():void{
            throw (new IllegalOperationError("This is a base class, overwrite this method"));
        }
        public function stop():void{
            throw (new IllegalOperationError("This is a base class, overwrite this method"));
        }
        public function get isPlaying():Boolean{
            return (this.timeline.isPlaying);
        }
        public function destroy():void{
            this.interrupt();
            this._timeline = null;
            this._context = null;
            this.timeline.removeEventListener(Event.COMPLETE, this.onSequenceComplete);
            this.timeline.destroy();
        }
        protected function get timeline():SequenceBasedStatesTimeline{
            return (this._timeline);
        }
        protected function get context():SunFaceStateManager{
            return (this._context);
        }
        private function onSequenceComplete(_arg1:InfoEvent):void{
            this.onTimelineAnimationFinished(_arg1.info.sequence_label);
        }
        protected function playFromLabel(_arg1:String):void{
            this.timeline.playFromFrameLabel(_arg1);
        }
        protected function onTimelineAnimationFinished(_arg1:String):void{
            throw (new IllegalOperationError("This is a base class, overwrite this method"));
        }
        protected function interrupt():void{
            this.timeline.interrupt();
        }
        protected function gotoAndStop(_arg1:Object):void{
            this.timeline.gotoAndStop(_arg1);
        }
        private function stopTimeline():void{
            this.timeline.interrupt();
        }

    }
}//package net.wooga.pets.views.components.sunface.states 
